package com.example.demo;

import org.noear.solon.annotation.Controller;
import org.noear.solon.annotation.Mapping;
import org.noear.solon.annotation.Path;
import org.noear.solon.core.handle.ModelAndView;

@Controller
public class DemoController {
  @Mapping("{id}")
  public String get(@Path Long id) {
    return String.format("Hello %d!", id);
  }

  @Mapping("/view")
  public ModelAndView view() {
    return new ModelAndView("view.shtm").put("name", "world");
  }
}